<?php slot('article') ?>
<?php get_component('leftMenuWidget', 'render') ?>
<?php use_stylesheet('/project_css_js/tooted.css') ?>
<div class="pealkiri">
	<p class="mis"><?php echo $node['pageTitle'] ?></p>
</div>

<?php if(!$sf_request->hasParameter('page') || $sf_request->getParameter('page') == 1):  ?>
	<?php echo $category['description'] ?>
<?php endif; ?>

<?php if(count($products)): ?>
<div class="tagasisidebox">
	<div class="tootevalik">
			<?php
				$links = LinkGen::getInstance(LinkGen::PRODUCT)->collectionLinks($products);
				$c = 0;
			?>
		
		<?php foreach($products as $product): ?>
			<?php if($c%2==0): ?><div class="tootevalikrow <?php echo $c!=0 ? "last" : "" ?>"><?php endif; ?>
				<div class="<?php echo $c%2==0 ? "left" : "right" ?>">
					<div class="tootethumb">
						<a href="<?php echo $links[$product['id']] ?>"><img src="<?php echo @myPicture::getInstance($product['ProductPictures'][0]['file'])->thumbnail(216,176)->url() ?>" width="216" height="176" alt=""/></a>
					</div>
					<div class="tootelink">
						<a href="<?php echo $links[$product['id']] ?>"><?php echo $product['name'] ?></a>
					</div>
				</div>
			<?php if($c%2==1): ?></div><div class="clear"></div><?php endif; ?>
		<?php ++$c ?>
		<?php endforeach; ?>
		<?php if($c%2==1): ?></div><div class="clear"></div><?php endif; ?>
</div>
	<?php include_partial('categoryPage/paging', array('category' => $category, 'pager' => $pager)) ?>
</div>
<?php endif; ?>
<?php end_slot() ?>
